import { Button } from "antd";
import { useActionState, useDebugValue, useDeferredValue, useState } from "react";


function useTime2(date) {
    const [time, setTime] = useState(date);
    const [time1, setTime2] = useState(90);
    useDebugValue(time, time => new Date(time));//请注意这一行代码
    // useDebugValue('sdfsdf');//请注意这一行代码
    return [time, setTime];
}

export default function MyButton({ }) {
    useTime2(Date.now())
    const [index, setIndex] = useState(0)
    const deffer = useDeferredValue(index, 2)
    console.log('MyButton render ');
    console.log('deffer ', deffer);
    console.log('index ', index);


    return (
        <form>
            <Button onClick={() => {
                setIndex(index + 1)
            }}>+++</Button>
        </form>
    )
}